package com.ruoyi.web.controller.tzzl;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tzzl.domain.WzMatchmakerLevel;
import com.ruoyi.tzzl.service.IWzMatchmakerLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 等级管理Controller
 *
 * @author by caoyong
 * @date 2022/11/8
 **/
@RestController
@RequestMapping("/tzzl/level")
public class WzMatchmakerLevelController  extends BaseController {

    @Autowired
    private IWzMatchmakerLevelService wzMatchmakerLevelService;


    /**
     * 红娘等级列表
     * */
    @GetMapping("/matchmakerLevelList")
    public AjaxResult matchmakerLevelList(){
        return AjaxResult.success(wzMatchmakerLevelService.list());
    }

    /**红娘等级详情*/
    @GetMapping("/details/{id}")
    public AjaxResult details(Long id){
        return AjaxResult.success(wzMatchmakerLevelService.getById(id));
    }

    /**
     * 新增等级管理
     */
    @PostMapping("/addMatchmakerLevel")
    public AjaxResult addMatchmakerLevel(@RequestBody WzMatchmakerLevel wzMatchmakerLevel)
    {

        return AjaxResult.success(wzMatchmakerLevelService.save(wzMatchmakerLevel));
    }

}

